This repository was archived by the owner on Jul 16, 2026. It is now read-only.
Repository navigation
feat(telegram-bridge): record outbox audit on every reply (Phase 5.17) - #85
Merged
Merged
Conversation
….17) Closes bridge-family symmetry: Phase 5.15 added the reader (dashboard Outbox card), Phase 5.16 added discord-bridge writes; this phase ports the OSS telegram-bridge write site. Changes: - `src/telegram-bridge.py`: `send_reply(chat_id, text)` gains a `task_id: str | None = None` parameter. After the chunked text send, `outbox_log.append(channel_type='telegram', recipient=str(chat_id), body=clean_text, task_id=task_id)` is called inside a try/except — telemetry is best-effort and must never block a reply. The task-reply call site in `main()` passes `task_id=task_id` through; the proactive caller continues to omit it (matches OSS behavior). - `tests/telegram-bridge-outbox.test.py` (new, 7 tests): - Structural: exactly 1 append site, wrapped in try/except. - Signature: send_reply accepts task_id with None default. - Caller: task-reply site plumbs task_id=task_id through. - Variable-binding: append carries channel_type, recipient, body, task_id. - channel_type is "telegram" (matches dashboard _channel_icon map →✈️ ). - Round-trip: append → outbox_log → dashboard.get_outbox (isolated tmp workspace). - Positioning: append follows text-send loop, inside if clean_text: gate. 27/27 Python tests pass. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This was referenced Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes bridge-family outbox symmetry. Phase 5.15 added the dashboard reader + card; Phase 5.16 added discord-bridge writes; this phase ports OSS sutando's single telegram-bridge write site so telegram deliveries also surface in the dashboard's Outbox card with the✈️ icon.
Telegram-bridge has just one outbound entry point —
send_reply— through which both task replies and proactive owner DMs flow. So the port is small.Changes
src/telegram-bridge.pysend_reply(chat_id, text, task_id=None)— added the OSS-equivalenttask_idkwarg (defaultNonefor backward compat with the proactive-DM caller).api("sendMessage", ...)loop, append an outbox audit row wrapped intry / import outbox_log / append / except Exception: pass.poll_results) plumbstask_id=task_idthrough. Proactive-DM caller is unchanged (matches OSS).tests/telegram-bridge-outbox.test.py(new, 7 cases)send_replyacceptstask_idkwarg withNonedefault.task_id=task_id.telegrammatches dashboard_channel_iconmap.Phase 5.11 reconciliation
That phase deliberately skipped OSS's
task_idparameter because stando "didn't have outbox_log telemetry that needed it." Phase 5.15 brought outbox_log in; this phase finishes plumbing the param so audit rows carry the task linkage.Test plan
python3 tests/telegram-bridge-outbox.test.py→ 7/7pnpm -s typecheck→ cleanpython3 -m py_compile src/telegram-bridge.py→ cleanResult
Bridge → outbox → dashboard pipeline is now feature-complete across slack + discord + telegram.
Roadmap
dm-result.pyoutbox writes (REST fallback path; closes coverage gap when the live discord bridge is offline).Made with Cursor